﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<%
	response.setHeader("cache-control", "public");
%>
<!-- jsp文件头和头部 -->
<%@ include file="../system/admin/top.jsp"%>
<script type="text/javascript" src="static/js/myjs/head.js${getTime}"></script>
<script type="text/javascript" src="static/js/layer.js"></script>
<link rel="stylesheet" href="static/css/layui.css" media="all">
<script type="text/javascript">
	$(function() {

	})
</script>
</head>

<body>

	<div style="width: 1900px">
		<form action="<%=basePath%>/faxijianmian/faxijianmianAuditList.do"
			method="post" name="pageForm" id="pageForm"  class="form-inline">
			<!-- 高级查询=============================================================== -->
			<div style="border: 1px solid darkgray;padding: 6px; ">
               <div class="form-line" style="line-height: 40px">
					<label class="input-group-addon">退免申请编号：</label>
                       		<input style="width: 150px" type="text" class="form-control" name="reduApplyId" value="${pd.reduApplyId}" />
					<label class="input-group-addon">催收编号：</label>
                       		<input style="width: 150px" type="text" class="form-control" name="callLoanNid" value="${pd.callLoanNid}" />
					<label class="input-group-addon">还款订单号：</label>
                       		<input style="width: 150px" type="text" class="form-control" name="repaymentId" value="${pd.repaymentId}" />
					<label class="input-group-addon">借款人姓名：</label>
                       		<input style="width: 150px" type="text" class="form-control" name="realName" value="${pd.realName}" />
					<label class="input-group-addon">借款人身份证号：</label>
                       		<input style="width: 150px" type="text" class="form-control" name="contIdCard" value="${pd.contIdCard}" />
               </div>
               <label class="btn btn-primary btn-small" onclick="search();">查询</label>
               <c:if test="${QX2 == 1}">
                <label class="btn btn-primary btn-small exportExcelBtn" onclick="makeAll('确定要审核选中的数据吗?');">批量审核</label>
               </c:if>
           </div>
           <br>
			<!-- 高级查询=============================================================== -->
			<table id="table_report"
				class="table table-bordered table-hover">
				<thead>
					<tr>
						<th class="center" onclick="selectAll()"><label><input
								type="checkbox" id="zcheckbox" /><span class="lbl"></span></label></th>
						<th>退免申请编号</th>
						<th>催收编号</th>
						<th>借款产品名称</th>
						<th>借款人姓名</th>
						<th>借款人身份证</th>
						<th>还款订单号</th>
						<th>申请时间</th>
						<th>申请类型</th>
						<th>申请金额</th>
						<th>申请人</th>
						<th>有效期</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<!-- 开始循环 -->
					<c:choose>
						<c:when test="${not empty pageList}">
							<c:if test="${true}">
								<c:forEach items="${pageList}" var="var" varStatus="vs">
									<tr>
										<!-- 复选框 -->
										<td class='center' style="width: 30px;"><label><input
												type='checkbox' name='ids' value="${var.reduApplyId}" /><span
												class="lbl"></span></label></td>
										<!-- 复选框 -->
										<td>${var.reduApplyId}</td>
										<td>${var.callLoanNid}</td>
										<td>${var.productName}</td>
										<td>${var.realName}</td>
										<td>${var.contIdCard}</td>
										<td>${var.repaymentId}</td>
										<td><fmt:formatDate value="${var.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
										<td>
											<c:if test="${var.type=='1'}"><span style="color: green">减免</span></c:if>
											<c:if test="${var.type=='2'}"><span style="color: red">退回</span></c:if>
										</td>
										<td>${var.reduOverdueFee}</td>
										<td>${var.name}</td>
										<td><fmt:formatDate value="${var.reduDay}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
										<td  class="center" style="width: 100px;cursor: pointer;">
											<%-- <c:if test="${QX.edit != 1 && QX.del != 1 }">
												<span
													class="label label-large label-grey arrowed-in-right arrowed-in"><i
													class="icon-lock" title="无权限"></i></span>
											</c:if> --%>
											<div>	<c:if test="${var.status == 0 && QX2 == 1}">
														<a onclick="auditOne('${var.reduApplyId}');"  style="color: blue">审核 </a> |  
													</c:if>
												<c:if test="${true}">
													<a onclick="lookReduInfo('${var.reduInfo}');" style="color: blue">查看备注</a>
												</c:if>
											</div></td>
									</tr>
								</c:forEach>
							</c:if>
							<c:if test="${false}">
								<tr>
									<td colspan="100" class="center">您无权查看</td>
								</tr>
							</c:if>
						</c:when>
						<c:otherwise>
							<tr class="main_info">
								<td colspan="100" class="center">没有相关数据</td>
							</tr>
						</c:otherwise>
					</c:choose>
				</tbody>
			</table>

			<div class="page-header position-relative">
				<table style="width: 100%;">
					<tr>
						<td style="vertical-align: top;"><div class="pagination"
								style="float: right; padding-top: 0px; margin-top: 0px;">${page.pageStr}</div></td>
					</tr>
				</table>
			</div>
		</form>
	</div>
	<!--/.fluid-container#main-container-->
	<!-- 模态框 -->
	
	<div id="motaikuang" class="modal fade" tabindex="-1" role="dialog" style="display: none;">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	       <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">罚息减免说明</h4>
      </div>
      <div class="modal-body">
	        <p id="remarkInfo"></p>
	      </div>
	       <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
	<!-- 模态框 -->
	<!-- 返回顶部  -->
	<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse"> <i
		class="icon-double-angle-up icon-only"></i>
	</a>
	<!-- 引入 -->
	<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
	<script src="static/js/bootstrap.min.js"></script>
	<script src="static/js/ace-elements.min.js"></script>
	<script src="static/js/ace.min.js"></script>
	
	<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script>
	<!-- 下拉框 -->
	<script type="text/javascript"
		src="static/js/bootstrap-datepicker.min.js"></script>
	<!-- 日期框 -->
	<script type="text/javascript" src="static/js/bootbox.min.js"></script>
	<!-- 确认窗口 -->
	<!-- 引入 -->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
	<script type="text/javascript">
		$(top.hangge());
		//检索
		function search(){
			top.jzts();
			$("#pageForm").submit();
		}
		//单个审核
		function auditOne(reduApplyId){
			 top.jzts();
			 var diag = new top.Dialog();
			 diag.Drag=true;
			 diag.Title ="单笔审核";
			 diag.URL = '<%=basePath%>faxijianmian/auditOne.do?reduApplyId='+reduApplyId;
			 diag.Width = 700;
			 diag.Height = 520;
			 diag.CancelEvent = function(){ //关闭事件
				if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
					 nextPage(${page.currentPage});
				}
				diag.close();
			 };
			  diag.show();
		}
		
		
		//全选 （是/否）
		function selectAll(){
			 var checklist = document.getElementsByName ("ids");
			   if(document.getElementById("zcheckbox").checked){
			   for(var i=0;i<checklist.length;i++){
			      checklist[i].checked = 1;
			   } 
			 }else{
			  for(var j=0;j<checklist.length;j++){
			     checklist[j].checked = 0;
			  }
			 }
		}
		//批量审核
		function makeAll(msg){
			
			if(confirm(msg)){ 
				
					var str = '';
					for(var i=0;i < document.getElementsByName('ids').length;i++)
					{
						  if(document.getElementsByName('ids')[i].checked){
						  	if(str=='') str += document.getElementsByName('ids')[i].value;
						  	else str += ',' + document.getElementsByName('ids')[i].value;
						  }
					}
					if(str==''){
						layer.alert("您没有选择任何内容!"); 
						return;
					}else{
						if(msg == '确定要审核选中的数据吗?'){
							console.log(str);//打印参数
							 top.jzts();
							 var diag = new top.Dialog();
							 diag.Drag=true;
							 diag.Title ="批量审核";
							 diag.URL = '<%=basePath%>/faxijianmian/auditBatch.do?DATA_IDS='+str;
							 diag.Width = 1000;
							 diag.Height = 520;
							 diag.CancelEvent = function(){ //关闭事件
								if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
									 nextPage(${page.currentPage});
								}
								diag.close();
							 };
							  diag.show();
						}
					}
			}
		}
		
		//查看备注
		function lookReduInfo(reduInfo){
			//打开模态框
			$("#remarkInfo").html(reduInfo);
			$("#motaikuang").modal("show");
		}
	</script>

</body>
</html>

